package com.moli.iov.real.service;

import com.moli.iov.protocol.model.realtime.RealTimeInfo;
import com.moli.iov.protocol.model.realtime.RealTimeInfoReq;
import com.moli.iov.real.model.res.VehicleLocationDto;
import com.moli.iov.real.model.res.VehicleStatusDto;
import com.moli.iov.rest.RestResponse;
import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 实时服务 服务类
 * </p>
 * @author lws
 * @since 2018-11-27
 */
public interface IRealService  {

    /**
     * 根据车架号集合获取在线数
     * @param vinList
     * @return
     * @throws Exception
     */
    RestResponse<Integer> getVehicleOnlineCount(List<String> vinList)  throws Exception;

    RestResponse<List<String>> getLocationVinList();


    RestResponse<Date> getLastOnlineTime(String vin);

    RestResponse<String> deleteAllOnlineVins();

    /**
     * 根据车架号集合获取在线vin集合
     * @param vinList
     * @return
     * @throws Exception
     */
    RestResponse<List<String>> isOnlineList(List<String> vinList) throws Exception;

    /**
     * 获取所有车辆实时状态
     * @return
     * @throws Exception
     */
//    RestResponse<List<RealTimeInfoDto>> listAllRealTimeInfo() ;

    /**
     * 根据车架号集合获取定位状态map
     * @param vinList
     * @return
     * @throws Exception
     */
    RestResponse<Map<String,Boolean>> isLocationVinMap(List<String> vinList)  throws Exception;

    /**
     * 获取全量在线车架号集合
     * @return
     * @throws Exception
     */
    RestResponse<List<String>> queryAllOnlineList()  throws Exception;


    /**
     * 批量查询车辆上下线状态
     * param vinList
     * return Map<String,Boolean>
     * */
    RestResponse<Map<String,Boolean>> isOnlineMap(List<String> vinList)  throws Exception;

    /**
     * 查询单个车辆在线状态
     * param vin
     * return Boolean
     * */
    RestResponse<Boolean> isOnline(String vin)  throws Exception;


    /**
     * 根据车架号集合获取 key:vin,value:RealTimeInfo Map
     * @param vin
     * @return
     * @throws Exception
     */
//    RestResponse<Map<String,RealTimeInfoDto>> getRealTimeInfoMap(List<String> vinList)  throws Exception;

    RestResponse<RealTimeInfo> getRealTime(String vin) throws Exception;

    /**
     * 根据车架号集合获取实时报文集合
     * @param vin
     * @return
     * @throws Exception
     */
    RestResponse<List<RealTimeInfo>> listRealTimeInfo(List<String> vin)  throws Exception;

    RestResponse<Map<String, VehicleStatusDto>> getVehicleStatusByVin(List<String> vin);

    RestResponse<Map<String, VehicleStatusDto>> getAllVehicleStatus();

    /**
     * 查询单个车辆实时数据
     * param vin
     * return RealTimeInfo
     * */
    RestResponse<RealTimeInfoReq> getRealTimeInfo(String vin)  throws Exception;

    RestResponse<Date>  getLastReportTime(String vin) throws Exception;

    RestResponse<Map<String,Date>> getLastReportTimeMap(List<String> list) throws Exception;

    RestResponse<VehicleLocationDto> getLocation(String vin) throws Exception;

    RestResponse<Map<String, Integer>> getDynamicStateMap(List<String> vinList);
}
